package model;

public class Act_Fou_Reposer extends Act_Fourmi{

	
	
	public Act_Fou_Reposer(Ind_Fourmi _fourmiHote) {
		super(_fourmiHote);
		priority = 12;
		
	}

	protected void updatePriority(){
		if((fourmiHote.getFatigueCounter()/30)<12){
			priority = 25 - fourmiHote.getFatigueCounter()/30;
		}else{
			priority = 12;
		}
		
	}

	@Override
	protected void doAction() {
		if(fourmiHote.atHome()){	
			rest();
			updatePriority();
		}
	}
	
	
	private void rest(){
			fourmiHote.setFatigueCounter((MonTimer.u_jour/2));		
	}
}
